import java.util.*;
public class Management {

	private ArrayList <Order> orders;
	private ArrayList <RunnableChef> chefs;
	private ArrayList <RunnableDeliveryPerson> deliveryPersons;
	private ArrayList <Dish> menu;
	
	private Statistics stats;
	private Address restaurantAddress;
	
	public Management () {
		
	}
	
	public void runSimulation () {
		for (Order currentOrder: orders) {
			int chefIndex;
			chefIndex = findAvailableChef(currentOrder.getDifficulty());
			if (chefIndex >= 0) chefs.at(chefIndex).cook(currentOrder);
		}
	}
	
	private int findAvailableChef(double orderDifficulty) {
		int chefIndex = -1;
		for (RunnableChef currentChef : chefs) {
		    if (currentChef.isAvailable(orderDifficulty))
		    	chefIndex = chefs.indexOf(currentChef);
		}
		return chefIndex;
	}
	 
	
}
